﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KBS8.Shared
{
    abstract class MapDataEdge
    {
        public static int ZoomLevel { get; protected set; } //Static zoomlevel
        
        protected MapDataNode A, B; //The 2 nodes that this edge connects

        public MapDataEdge(MapDataNode a, MapDataNode b)
        {
            A = a;
            B = b;
            A.AddEdge(this);
            B.AddEdge(this);
        }

        /// <summary>
        /// Returns the node on the other side of the edge
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public MapDataNode GetDestination(MapDataNode node)
        {
            if (node.Equals(A))
            {
                return B;
            }
            else
            {
                return A;
            }
        }
    }
}
